home *** CD-ROM | disk | FTP | other *** search
- #include "stdio.h"
- #include "string.h"
-
- void main()
- {
- int index;
- char string1[6], string2[6], string3[6], all_three[18];
-
- strcpy(string1, "one");
- strcpy(string2, "two");
- strcpy(string3, "three");
-
- strcpy(all_three, string1);
- strcat(all_three, " ");
- strcat(all_three, string2);
- strcat(all_three, " ");
- strcat(all_three, string3);
-
- for(index = 0 ; index < 10 ; index = index + 1)
- printf("The final string is ---> %s\n", all_three);
-
- }
-
-
-
- /* Result of execution
-
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
- The final string is ---> one two three
-
- */
-